//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Spreadsheet
{
    public class WebPublishing : IOfficeXmlSerializable
    {
        #region IOfficeXmlSerializable Members

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (ReadContext c = context.Read("webPublishing"))
            {
                css = c.GetOptionalBoolean("css", true);
                thicket = c.GetOptionalBoolean("thicket", true);
                longFileNames = c.GetOptionalBoolean("longFileNames", true);
                vml = c.GetOptionalBoolean("vml", false);
                allowPng = c.GetOptionalBoolean("allowPng", false);
                targetScreenSize = c.GetOptionalEnum("targetScreenSize", TargetScreenSize.Size800x600);
                dpi = c.GetOptionalInteger("dpi", 96);
                codePage = c.GetOptionalInteger("codePage");
            }
        }

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write("webPublishing"))
            {
                c.SetOptionalBoolean("css", css, true);
                c.SetOptionalBoolean("thicket", thicket, true);
                c.SetOptionalBoolean("longFileNames", longFileNames, true);
                c.SetOptionalBoolean("vml", vml, false);
                c.SetOptionalBoolean("allowPng", allowPng, false);
                c.SetOptionalEnum("targetScreenSize", targetScreenSize, TargetScreenSize.Size800x600);
                c.SetOptionalInteger("dpi", dpi, 96);
                c.SetOptionalInteger("codePage",codePage) ;
            }
        }

        #endregion
        private bool css = true;

        public bool Css
        {
            get { return css; }
            set { css = value; }
        }
        private bool thicket = true;

        public bool Thicket
        {
            get { return thicket; }
            set { thicket = value; }
        }
        private bool longFileNames = true;

        public bool LongFileNames
        {
            get { return longFileNames; }
            set { longFileNames = value; }
        }
        private bool vml = false;

        public bool Vml
        {
            get { return vml; }
            set { vml = value; }
        }
        private bool allowPng;

        public bool AllowPng
        {
            get { return allowPng; }
            set { allowPng = value; }
        }
        private TargetScreenSize targetScreenSize; //\\ tochange

        public TargetScreenSize TargetScreenSize
        {
            get { return targetScreenSize; }
            set { targetScreenSize = value; }
        }
        private int dpi = 96;

        public int Dpi
        {
            get { return dpi; }
            set { dpi = value; }
        }
        private int? codePage;

        public int? CodePage
        {
            get { return codePage; }
            set { codePage = value; }
        }








    }
}
